import Content from './views/Content.vue'
import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
import Main from './views/Main.vue'
import Log from './views/system/Log.vue'
import onlineUser from './views/system/onlineUser.vue'
import Role from './views/system/Role.vue'
import sysParam from './views/system/sysParam.vue'
import historyRecord from './views/system/HistoryRecord'
import Resource from './views/system/Resource.vue'
import Users from './views/system/Users.vue'
import setUser from './views/system/setUser'

/* 合同管理 */
import Contract_list from './views/contract/List';
import Contract_details from './views/contract/Details';
import Contract_addOrEdit from './views/contract/AddOrEdit';
import Contract_pending from './views/contract/PendingList';


//销售管理
import department from './views/sale/department'
import personnel from './views/sale/personnel/index'
import personnelList from './views/sale/personnel/list'
import personnelInfo from './views/sale/personnel/info'

import saleList from './views/sale/list.vue'
import saleDetails from './views/sale/details.vue'


/*业绩查询*/
import achievementList from './views/achievement/list';

/*客户列表*/
import customerList from './views/customer/list';
import customerInfo from './views/customer/info';

/*产品管理*/
import productList from './views/product/list';
import productInfo from './views/product/info';
import productAdd from './views/product/add';
import productEdit from './views/product/edit';

let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    {
        path: '/sale',
        perm: '',
        code: '10040',
        component: Home,
        name: '销售管理',
        iconCls: 'iconfont icon-xiaoshourenyuanguanli',
        children: [
            // {path: '/sale/list', component: saleList, name: '销售列表', code: "40010",meta:"/sale/list"},
            {path: '/sale/details/:id', component: saleDetails, name: '销售详情', code: "", hidden: true,meta:"/sale/list"},
            { path: '/department', component: department, name: '机构管理' ,code:"30020",meta:"/department"},
            { path: '/personnel', component: personnel, name: '人员管理' ,code:"30030",redirect:'/list',meta:"/personnel",
                children:[
                    { path: '/list', component: personnelList, name: '列表' ,code:"50000", hidden: true,meta:"/personnel"},
                    { path: '/info/:id', component: personnelInfo, name: '详情',code:"50030", hidden: true,meta:"/personnel"},
                    { path: '/personnel/add', component: personnelInfo, name: '添加',code:"50020", hidden: true,meta:"/personnel"},
                ]
            }
        ]
    },


    // 业绩查询
    {
        path: '/achievement',
        perm: '',
        code: '10010',
        component: Home,
        name: '业绩查询',
        iconCls: 'iconfont icon-9',
        children: [
            {path: '/achievement/list', component: achievementList, name: '业绩列表', code: "30010", meta: "/list"},
        ]
    },


    // 客户列表
    {
        path: '/customer',
        perm: '',
        code: '10020',
        component: Home,
        name: '客户管理',
        iconCls: 'iconfont icon-9',
        children: [
            {path: '/customer/list', component: customerList, name: '客户列表', code: "30000", meta: "/customer/list"},
            {path: '/customer/info/:id', component: customerInfo, name: '客户详情', code: "30020", hidden: true, meta: "/customer/list"}
        ]
    },


    // 产品管理
    {
        path: '/product',
        perm: '',
        code: '10030',
        component: Home,
        name: '产品管理',
        iconCls: 'iconfont icon-9',
        children: [
            {path: '/product/list', component: productList, name: '产品列表', code: "30000", meta: "/list"},
            {path: '/product/info/:id', component: productInfo, name: '查看产品', code: "30020", hidden: true, meta: "/list"},
            {path: '/product/add', component: productAdd, name: '新增产品', code: "30030", hidden: true, meta: "/list"},
            {path: '/product/edit/:id', component: productEdit, name: '编辑产品', code: "30040", hidden: true, meta: "/list"}
        ]
    },
    {
        path: '/contract',
        perm: '',
        code: '10050',
        component: Home,
        name: '合同管理',
        iconCls: 'iconfont icon-9',
        children: [
            { path: '/contract/list', component: Contract_list, name: '合同列表', code: '30010', meta: '/list'},
            { path: '/contract/detail/:id', component: Contract_details, name: '合同详情',code:"50020", hidden: true, meta:"/list"},
            { path: '/contract/add', component: Contract_addOrEdit, name: '添加合同',code:"50030", hidden: true, meta:"/list"},
            { path: '/contract/edit/:id', component: Contract_addOrEdit, name: '修改合同',code:"50070", hidden: true, meta:"/list"},
            { path: '/pending/contract/list', component: Contract_pending, name: '待审核列表',code:"30020", meta:"/pending/contract/list"}
        ]
    },
    {
        path: '/',
        perm: '',
        code: '10060',
        component: Home,
        name: '系统管理',
        iconCls: 'iconfont icon-xitongshezhi',
        children: [
            {path: '/users', component: Users, name: '用户管理', code: "103500", meta: '/users'},
            {path: '/resource', component: Resource, name: '资源管理', code: "103000", meta: '/resource'},
            {path: '/role', component: Role, name: '角色管理', code: "102500", meta: '/role'},
            // {path: '/onlineuser', component: onlineUser, name: '在线用户', code: "102000",meta:'/onlineuser'},
            {path: '/log', component: Log, name: '行为日志', code: "100500", meta: '/log'},
            /*    {path: '/sysparam', component: sysParam, name: '系统参数', code: "101000",meta:'/sysparam'},
                {path: '/history', component: historyRecord, name: '参数历史记录', code: "30090",meta:'/history'},*/
            {path: '/setuser', component: setUser, name: '个人设置', hidden: true},
        ]
    },
    {
        path: '*',
        hidden: true,
        redirect: {path: '/404'}
    }
];


export default routes;